<template>
  <div class="titleBox">
    <div class="title flex justify-between items-center">
      <div class=" flex justify-start items-center">
        <img class="icon_xinxiang" :src="icon" />
        <span class="title-text">{{ title }}</span>
      </div>
      <div v-if="showMore" class="cursor-pointer" @click="clickMoreFuc">更多 <i class="el-icon-caret-right"></i></div>
    </div>
    <div class="content">
      <!-- v-bind="scope" -->
      <slot name="content"></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'TitleBox',
  props: {
    icon: {
      type: String,
      default: "",
    },
    title: {
      type: String,
      default: "",
    },
    showMore: {
      type: Boolean,
      default: false,
    }
  },
  watch: {},
  data() {
    return {

    };
  },
  methods: {
    clickMoreFuc() {
      this.$emit("clickMore");
    }
  }
};
</script>

<style lang='scss' scoped>
.titleBox {
  height: 100%;
  width: 100%;
  background: #fff;
  border: 1px solid #d5d5d5;


  .title {
    // padding: 0px 18px;
    padding: 0px 20px;
    width: 100%;
    height: 34px;
    background: linear-gradient(177deg, #3a8edc 0%, #2d72b2 100%);
    color: #fff;



    .title-text {
      text-align: center;
      line-height: 34px;
      // width: 130px;
      height: 34px;
      border-radius: 4px 4px 0px 0px;
      color: #fff;
    }

    img {
      margin-right: 10px;
    }
  }

  .content {
    padding: 20px;
  }
}
</style>